//
//  ReadLocalJsonFile.m
//  NewGeneration
//
//  Created by tikpen on 3/26/20.
//  Copyright © 2020 tikpen. All rights reserved.
//

#import "ReadLocalJsonFile.h"

@implementation ReadLocalJsonFile

+ (NSArray *)readLocalFileWithName:(NSString *)name
{
    // 获取文件路径
    NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"json"];
    // 将文件数据化
    NSData *data = [[NSData alloc] initWithContentsOfFile:path];
    
    return [NSJSONSerialization JSONObjectWithData:data
                                           options:kNilOptions
                                             error:nil];
}

@end
